// pages/my/personal_details/personal_details.js
Page({


  data: {
    headImage:'',
    nickname:'',
    sex:1,
  },

  onLoad: function (options) {
    var userName = options.userName; //用户名
    var imgUrl = options.imgUrl;
    this.setData({
      headImage: imgUrl,
      nickname:userName,
    })
    
  },



  changedHeadImageClick(){
    var _this = this;
    app.chooseImageAndUpLoad(1).then(res => {
      if (res) {
        var url = res[0];
        _this.setData({
          headImage:url
        });
      }
    });
  },
  nickNameChange(e){
    var value = e.detail.value;
    this.setData({
      nickname:value
    });
  },

  saveUserData:function(){
    wx.navigateBack({
      delta: 1,
    })
  }

})